const dev = {
    /** port 端口 */
    serverPort: 81,
    dbConfig: {
        host: '118.31.106.200',
        user: 'root',
        port: '3307',
        password: 'Wtkj@2025',
        database: 'wc_charge',
        waitForConnections: true,
        connectionLimit: 10,
        queueLimit: 0,
    },
    whiteList: ['/api/oper/login','/api/oprnid/login','/user/login', '/api/lsy/notify/refund','/api/lsy/notify','/api/applet/getOpenID','/api/applet/getPhoneNumber','/api/charge/autoRefundAndShare','/getTkoen'],
    applet_param: {
        APPID: 'wx2cde425090f43365',
         APPSECRET: 'e5abd8b2c651b76672e0c2e3a9d9cdf4'
    },
    redisConfig: 'redis://127.0.0.1:6379',
    pay_notify_url: 'http://118.31.106.200:81'
};

//连接到正式测试
// const dev = {
//     /** port 端口 */
//     serverPort: 81,
//     dbConfig: {
//         host: 'wc-charge.rwlb.rds.aliyuncs.com',
//         user: 'wc_soft',
//         port: '3306',
//         password: 'Wckj@2025',
//         database: 'wc_charge',
//         waitForConnections: true,
//         connectionLimit: 50,
//         queueLimit: 0,
//     },
//     whiteList: ['/api/oper/login','/api/oprnid/login','/user/login', '/api/lsy/notify/refund','/api/lsy/notify','/api/applet/getOpenID','/api/applet/getPhoneNumber','/api/charge/autoRefundAndShare','/getTkoen','/slb/check'],
//     applet_param: {
//         APPID: 'wx2cde425090f43365',
//          APPSECRET: 'e5abd8b2c651b76672e0c2e3a9d9cdf4'
//     },
//     redisConfig: 'redis://127.0.0.1:6379',
//     pay_notify_url: 'http://cd.wcchina.net'
// };

const production = {
    /** port 端口 */
    serverPort: 81,
    dbConfig: {
        host: 'pc-wz9x59h9ey60t12fd.rwlb.rds.aliyuncs.com',
        user: 'wc_soft',
        port: '3306',
        password: 'Wckj@2025',
        database: 'wc_charge',
        waitForConnections: true,
        connectionLimit: 50,
        queueLimit: 0,
    },
    whiteList: ['/api/oper/login','/api/oprnid/login','/user/login', '/api/lsy/notify/refund','/api/lsy/notify','/api/applet/getOpenID','/api/applet/getPhoneNumber','/api/charge/autoRefundAndShare','/getTkoen','/slb/check'],
    applet_param: {
        APPID: 'wx2cde425090f43365',
         APPSECRET: 'e5abd8b2c651b76672e0c2e3a9d9cdf4'
    },
    redisConfig: 'redis://127.0.0.1:6379',
    pay_notify_url: 'http://cd.wcchina.net'
};



let config = {
    /** port 端口 */
    serverPort: 9961,
    dbConfig: {
        host: 'dev.ktpark.net',
        user: 'root',
        port: '3306',
        password: 'ankuai',
        database: 'bcck',
        waitForConnections: true,
        connectionLimit: 10,
        queueLimit: 0,
    },
    whiteList: ['/oper/login', '/images', '/api/pay_notify', '/api/pay/appletPay', '/applet/queryPrice', '/api/applet/noPlateIn', '/api/lsy/merchant_status_change/notice', '/api/applet/isChannelPay','/slb/check'],
    createNotifyCallBack: 'http://dev.ktpark.net:9961/api/lsy/merchant_status_change/notice',
};

(() => {
    console.log('process.env.NODE_ENV', process.env.NODE_ENV);
    config = {
        ...config,
        ...{ dev, production }[process.env.NODE_ENV || 'dev'],
    };
    console.log('config', config);
})();

export default config;
